package testcase;

import junit.framework.TestCase;
import maincode.*;

public class CorGenatorTest extends TestCase{
	private corGenator CorGenator;

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
	public void tearDown() {}
	
	// Test case 1
	public void test1() {
		double result;
		double [] arr1={1,2,3};
		double [] arr2={3,4,5};
		CorGenator = new corGenator(arr1,arr2);
		result = CorGenator.returnCor(1);
		assertEquals(result, 1.0);
	}
	
	// Test case 2
	public void test2() {
		double result;
		double [] arr1={7.750,7.750,7.750,7.750,7.750,7.750,7.750,7.750,7.751,7.751,7.751,7.751,7.752};
		double [] arr2={0.0759,0.0761,0.0762,0.0763,0.0765,0.0765,0.0764,0.0763,0.0762,0.0764,0.0764,0.0765,0.0765};
		CorGenator = new corGenator(arr1,arr2);
		result = CorGenator.returnCor(1);
		assertEquals(result, 0.49095402694523854);
	}
	
	// Test case 3
		public void test3() {
			double result;
			double [] arr1={12.06,11.93,-11.85,11.86,11.96};
			double [] arr2={4.31,4.25,4.22,4.21,-4.23};
			CorGenator = new corGenator(arr1,arr2);
			result = CorGenator.returnCor(1);
			assertEquals(result, -0.3256351285850663);
		}

}

